package week_09;

import java.util.Scanner;

public class Tower {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] h = new int[n];
        int[] sum = new int[n + 1];
        sum[0] = 0;
        for (int i = 0; i < n; i++) {
            h[i] = input.nextInt();
            sum[i + 1] = sum[i] + h[i];
        }

        int[] dp = new int[n + 1];
        int[] last = new int[n + 1];
        dp[0] = 0;

        for (int i = 1; i <= n; ++i)
            for (int j = 0; j < i; ++j)
                if (sum[i] - sum[j] >= last[j]) {
                    dp[i] = dp[j] + 1;
                    last[i] = sum[i] - sum[j];
                }
//        for(int i = 1;i <= n;i ++)
//            for(int j = 0;j < i;j ++) {
//                if(sum[i] - sum[j] >= last[j]) {
//                    if(dp[j] + 1 > dp[i]) {
//                        dp[i] = dp[j] + 1;
//                        last[i] = sum[i] - sum[j];
//                    }
//                    else if(dp[j] + 1 == dp[i]) {
//                        last[i] = Math.min(last[i],sum[i] - sum[j]);
//                    }
//                }
//            }
        System.out.println(n - dp[n]);
    }
}
